﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LeetCodeSolutions
{
    /// <summary>
    /// 53.最大子序和
    /// </summary>
    class LeetCode53: LeetCodeBase
    {
        public override void Execute()
        {
            int[] nums = new int[] { -2, 1, -3, 4, -1, 2, 1, -5, 4 };
            CommonFuntions.Print(MaxSubArray(nums));
        }

        public int MaxSubArray(int[] nums)
        {
            if (nums.Length == 1)
            {
                return nums[0];
            }

            int maxValue = nums[0];
            for (int i = 0; i < nums.Length; i++)
            {
                if (nums[i] < 0)
                {
                    continue;
                }

                for (int j = i; j < nums.Length; j++)
                {

                }
            }

            return 0;
        }
    }
}
